﻿using System.Collections;
using System.Collections.Generic;
using CardGameCore.Battle;
using CardGameCore.Common;
using CardGameCore.Driver;
using UnityEngine;
using Zenject;

namespace CardGame.InGame
{
    public class CoreInstaller : Installer<CoreInstaller>
    {
        [Inject] private readonly int _seed;
        public override void InstallBindings()
        {
            Container.Bind<IRandom>().To<PcgRandom>().AsSingle()
                .WithArguments(_seed);
            Container.Bind<ICoreDriver>().To<CoreDriver>().AsSingle();
            Container.Bind<IBattlefield>().To<Battlefield>().AsSingle();
            Container.Bind<IBattleInitialize>().To<BattleInitialize>().AsSingle();
            Container.BindInterfacesTo<DataProvider>().AsSingle();
            Container.BindInterfacesTo<CoreSetting>().AsSingle();
            BattleInstall();
        }

        private void BattleInstall()
        {
            Container.Bind<IGamePrepare>().To<GamePrepare>().AsSingle();
            Container.Bind<IRoundPrepare>().To<RoundPrepare>().AsSingle();
            Container.Bind<IPlayerSelectCard>().To<PlayerSelectCard>().AsSingle();
            Container.Bind<ISelectCardJudge>().To<SelectCardJudge>().AsSingle();
            Container.Bind<ISelectCardAi>().To<SelectCardAi>().AsSingle();
            Container.Bind<IPlayerAction>().To<PlayerAction>().AsSingle();
            Container.Bind<IEnemyAction>().To<EnemyAction>().AsSingle();
            Container.Bind<IEnemySelectCard>().To<EnemySelectCard>().AsSingle();
            Container.Bind<IHorizontalFinder>().To<HorizontalFinder>().AsSingle();
            Container.Bind<IDamageHandler>().To<DamageHandler>().AsSingle();
            Container.Bind<IBattleJudge>().To<BattleJudge>().AsSingle();
        }
    }

}


